<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>个人资料</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body { background: linear-gradient(135deg, #1B263B, #6B7280); color: #FFFFFF; }
        .capsule-card { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }
    </style>
</head>
<body>
    <nav class="navbar navbar-dark bg-dark">
        <div class="container">
            <a class="navbar-brand" href="{% url 'homepage' %}">时间胶囊</a>
            <div>
                <a class="btn btn-outline-light" href="{% url 'logout' %}">注销</a>
            </div>
        </div>
    </nav>
    <div class="container mt-5">
        <h2>我的个人资料</h2>
        <h3>我的时间胶囊</h3>
        <div class="row">
            {% for capsule in capsules %}
                <div class="col-md-4 mb-3">
                    <div class="capsule-card p-3">
                        <h5>{{ capsule.title }}</h5>
                        <p>开启日期: {{ capsule.opening_date }}</p>
                        <a href="{% url 'view_capsule' capsule.pk %}" class="btn btn-primary">查看</a>
                    </div>
                </div>
            {% empty %}
                <p>您还没有创建时间胶囊！</p>
            {% endfor %}
        </div>
        <a href="{% url 'create_capsule' %}" class="btn btn-success mt-3">创建新胶囊</a>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>